// ignore_for_file: non_constant_identifier_names, camel_case_types
import 'package:flutter/material.dart';
import 'package:rlstyles/main.dart';

enum FL_DISPLAY_ENUM { flex, list, no }

// display
FL_DISPLAY({FL_DISPLAY_ENUM display = FL_DISPLAY_ENUM.flex}) =>
    {CssRule.display: display.name};

// box
FL_BOX_SIZING(FL_BOX_SIZING_ENUM boxSizing) => {CssRule.boxSizing: boxSizing};

// no_flex
const FL_FLEX_NO = {CssRule.flexNo: true};

const FL_NO_FLEX = {CssRule.flexNo: true};

// row
const FL_FlexRow = {CssRule.flexDirection: 'row'};
const FL_FlexRowReverse = {CssRule.flexDirection: 'row-reverse'};

// column
const FL_FlexColumn = {CssRule.flexDirection: 'column'};
const FL_FlexColumnReverse = {CssRule.flexDirection: 'column-reverse'};

// wrap
const FL_FlexWrap = {CssRule.flexWrap: 'wrap'};
const FL_FlexNoWrap = {CssRule.flexWrap: 'nowrap'};

// Justify
const FL_JustifyStart = {CssRule.justifyContent: 'flex-start'};
const FL_JustifyCenter = {CssRule.justifyContent: 'center'};
const FL_JustifyEnd = {CssRule.justifyContent: 'flex-end'};
const FL_JustifyBetween = {CssRule.justifyContent: 'space-between'};
const FL_JustifyAround = {CssRule.justifyContent: 'space-around'};

// align
const FL_AlignStart = {CssRule.alignItems: 'flex-start'};
const FL_AlignCenter = {CssRule.alignItems: 'center'};
const FL_AlignEnd = {CssRule.alignItems: 'flex-end'};
const FL_ItemStart = FL_AlignStart;
const FL_ItemCenter = FL_AlignCenter;
const FL_ItemEd = FL_AlignEnd;

// padding
FL_Padding({dynamic size}) => {CssRule.padding: size};
FL_PaddingLeft({dynamic size}) => {CssRule.paddingLeft: size};
FL_PaddingRight({dynamic size}) => {CssRule.paddingRight: size};
FL_PaddingTop({dynamic size}) => {CssRule.paddingTop: size};
FL_PaddingBottom({dynamic size}) => {CssRule.paddingBottom: size};
FL_PaddingX({dynamic size}) =>
    {CssRule.paddingLeft: size, CssRule.paddingRight: size};
FL_PaddingY({dynamic size}) =>
    {CssRule.paddingTop: size, CssRule.paddingBottom: size};

// margin
FL_Margin({dynamic size}) => {CssRule.margin: size};
FL_MarginLeft({dynamic size}) => {CssRule.marginLeft: size};
FL_MarginRight({dynamic size}) => {CssRule.marginRight: size};
FL_MarginTop({dynamic size}) => {CssRule.marginTop: size};
FL_MarginBottom({dynamic size}) => {CssRule.marginBottom: size};
FL_MarginX({dynamic size}) =>
    {CssRule.marginLeft: size, CssRule.marginRight: size};
FL_MarginY({dynamic size}) =>
    {CssRule.marginTop: size, CssRule.marginBottom: size};
// width
FL_Width({dynamic size}) => {CssRule.width: size};
final FL_WFull = {CssRule.width: '100%'};

// height
FL_Height({dynamic size}) => {CssRule.height: size};
final FL_HFull = {CssRule.height: '100%'};

// font
FL_FWeight({dynamic size}) => {CssRule.fontWeight: size};
FL_Font_Weight({dynamic size}) => {CssRule.fontWeight: size};
FL_Font_Family({dynamic text}) => {CssRule.fontFamily: text};
final FL_FFamily = FL_Font_Family;

// 限制文本行数
FL_MaxLines({dynamic size}) => {CssRule.maxLines: size};
Fl_TextOverflow({dynamic type}) => {CssRule.textOverflow: type};

// fontSize
FL_FSize({dynamic size}) => {CssRule.fontSize: size};
FL_Font_Size({dynamic size}) => FL_FSize(size: size);
final FL_FSizeLg = {CssRule.fontSize: '20px'};
final FL_SizeSm = {CssRule.fontSize: '15px'};
final FL_FSizeXs = {CssRule.fontSize: '12px'};

// fontColor
FL_Color({dynamic color}) => {CssRule.color: color};
FL_Font_Color({dynamic color}) => {CssRule.color: color};
Fl_FColor({dynamic color}) => {CssRule.color: color};
final FL_ColorBlack = {CssRule.color: '#000'};
final FL_ColorWhite = {CssRule.color: '#fff'};
final FL_ColorRed = {CssRule.color: '#f00'};
final FL_ColorGreen = {CssRule.color: '#0f0'};
final FL_ColorBlue = {CssRule.color: '#00f'};

// 线条样式
FL_TextDecoration({dynamic text}) => {CssRule.textDecoration: text};
// 是否开启圆角裁剪
FL_Clip_Radius({bool state = false}) => {CssRule.clipRadius: state};

// radius
FL_Radius({dynamic size}) => {CssRule.borderRadius: size};
final FL_BorderRadius = FL_Radius;

final FL_RadiusLg = {CssRule.borderRadius: '5px'};
final FL_RadiusSm = {CssRule.borderRadius: '2px'};
final FL_RadiusXs = {CssRule.borderRadius: '1px'};
FL_RadiusLeftTop({dynamic size}) => {CssRule.borderTopLeftRadius: size};
FL_RadiusLeftBottom({dynamic size}) =>
    {CssRule.borderBottomLeftRadius: getSize(size: size, defValue: 0.0)};
FL_RadiusRightTop({dynamic size}) =>
    {CssRule.borderTopRightRadius: getSize(size: size, defValue: 0.0)};
FL_RadiusRightBottom({dynamic size}) =>
    {CssRule.borderBottomRightRadius: getSize(size: size, defValue: 0.0)};

// border
FL_Border({dynamic size, dynamic color}) => {
      CssRule.borderWidth: size,
      CssRule.borderStyle: 'solid',
      CssRule.borderColor: color
    };

FL_BorderBottom({
  dynamic size,
  dynamic color,
}) =>
    {
      CssRule.borderBottomWidth: size,
      CssRule.borderBottomColor: color,
      CssRule.borderBottomStyle: 'solid'
    };

FL_BorderTop({
  dynamic size,
  dynamic color,
}) =>
    {
      CssRule.borderTopWidth: size,
      CssRule.borderTopColor: color,
      CssRule.borderTopStyle: 'solid'
    };

FL_BorderLeft({
  dynamic size,
  dynamic color,
}) =>
    {
      CssRule.borderLeftWidth: size,
      CssRule.borderLeftColor: color,
      CssRule.borderLeftStyle: 'solid'
    };

FL_BorderRight({
  dynamic size,
  dynamic color,
}) =>
    {
      CssRule.borderRightWidth: size,
      CssRule.borderRightColor: color,
      CssRule.borderRightStyle: 'solid'
    };

FL_BorderColor({dynamic color}) => {CssRule.borderColor: color};

FL_BorderLeftTop({dynamic size, dynamic color}) => {
      CssRule.borderLeftWidth: size,
      CssRule.borderLeftStyle: 'solid',
      CssRule.borderLeftColor: color
    };

FL_BorderLeftBottom({dynamic size, dynamic color}) => {
      CssRule.borderLeftWidth: size,
      CssRule.borderLeftStyle: 'solid',
      CssRule.borderLeftColor: color
    };

FL_BorderRightTop({dynamic size, dynamic color}) => {
      CssRule.borderRightWidth: size,
      CssRule.borderRightStyle: 'solid',
      CssRule.borderRightColor: color
    };

FL_BorderRightBottom({dynamic size, dynamic color}) => {
      CssRule.borderRightWidth: size,
      CssRule.borderRightStyle: 'solid',
      CssRule.borderRightColor: color
    };

const FL_BorderSolid = {CssRule.borderStyle: 'solid'};

// backGroundColor
FL_BgColor({dynamic color}) => {CssRule.backgroundColor: color};
FL_BackgroundColor({dynamic color}) => {CssRule.backgroundColor: color};

// position
final FL_Absolute = {CssRule.position: 'abs'};
final FL_Relative = {CssRule.position: 'rel'};

// zIndex
FL_ZIndex({dynamic index}) => {CssRule.zIndex: index};

// scroll
final FL_OverScrollY = {CssRule.overflowY: 'scroll'};
final FL_OverScrollX = {CssRule.overflowX: 'scroll'};

// flex
FL_Flex({dynamic size}) => {CssRule.flex: size};

// size
FL_MinWidth({dynamic size}) => {CssRule.minWidth: size};
FL_MinHeight({dynamic size}) => {CssRule.minHeight: size};
FL_MaxWidth({dynamic size}) => {CssRule.maxWidth: size};
FL_MaxHeight({dynamic size}) => {CssRule.maxHeight: size};

// abs
FL_AbsTop({dynamic size}) => {CssRule.top: size};
FL_AbsLeft({dynamic size}) => {CssRule.left: size};
FL_AbsRight({dynamic size}) => {CssRule.right: size};
FL_AbsBottom({dynamic size}) => {CssRule.bottom: size};

// opacity
FL_Opacity({dynamic size}) => {CssRule.opacity: size};

// backgroundSize
FL_BgSize({dynamic size}) => {CssRule.backgroundSize: size};
FL_BackgroundSize({dynamic size}) => {CssRule.backgroundSize: size};

// scrollBar
FL_ScrollBar({dynamic state}) => {CssRule.scrollBar: state};

// backgroundImage
FL_BgImage({dynamic size}) => {CssRule.backgroundImage: size};
FL_BackgroundImage({dynamic size}) => {CssRule.backgroundImage: size};

// backgroungSize
final FL_BgSizeCover = {CssRule.backgroundSize: BoxFit.cover};
final FL_BgSizeContain = {CssRule.backgroundSize: BoxFit.contain};
final FL_BgSizeFill = {CssRule.backgroundSize: BoxFit.fill};
final FL_BgSizeFitHeight = {CssRule.backgroundSize: BoxFit.fitHeight};
final FL_BgSizeFitWidth = {CssRule.backgroundSize: BoxFit.fitWidth};
final FL_BgSizeScaleDown = {CssRule.backgroundSize: BoxFit.scaleDown};

// transform
FL_Transform({dynamic matrix4}) => {CssRule.transform: matrix4};
